package com.wr.modules.log.controller;

import com.wr.common.core.result.R;
import com.wr.common.core.utils.BeanUtils;
import com.wr.api.system.domain.SysOperLogBo;
import com.wr.modules.log.domain.log.SysOperLog;
import com.wr.modules.log.service.ISysOperLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author MyPC
 */
@Tag(name = "B - 操作日志")
@RestController
@RequestMapping("/log")
public class SysOperLogController {

    @Autowired
    private ISysOperLogService iSysOperLogService;

    @Operation(summary = "添加操作日志")
    @PostMapping("/operLocation")
    public R<Integer> operLocation(@RequestBody SysOperLogBo sysLogininforBo) {
        return R.ok(iSysOperLogService.save(BeanUtils.copyDataProp(sysLogininforBo, new SysOperLog())));
    }
}
